﻿using System.Windows;
using Microsoft.Windows.Design.Features;
using Microsoft.Windows.Design.Metadata;
using System.ComponentModel;
using Okazuki.BehaviorSupport.Design.Commons;
using Microsoft.Windows.Design.PropertyEditing;
using Okazuki.BehaviorSupport.Design.Commons.Editors;

[assembly: ProvideMetadata(typeof(Okazuki.BehaviorSupport.VisualStudio.Design.BehaviorSupportRegister))]
namespace Okazuki.BehaviorSupport.VisualStudio.Design
{
    /// <summary>
    /// ビヘイビア系のサポートを追加する
    /// </summary>
    internal class BehaviorSupportRegister : IProvideAttributeTable
    {
        public AttributeTable AttributeTable
        {
            get
            {
                var builder = new AttributeTableBuilder();
                builder.AddCustomAttributes(
                    typeof(FrameworkElement),
                    new FeatureAttribute(typeof(BehaviorPrimarySelectionContextMenuProvider)));
                builder.AddCustomAttributes(
                    typeof(System.Windows.Interactivity.EventTrigger),
                    "EventName",
                    PropertyValueEditor.CreateEditorAttribute(typeof(EventNamePropertyEditor)));
                return builder.CreateTable();
            }
        }
    }
}
